/*****************************************************************************
 *
 * 作   者: 马婷婷.
 * 创建时间: 2020/12/10 15:31:17.
 *
 * Copyright (C) 2008 - 鹏业软件公司
 *
 *****************************************************************************/

// @ts-ignore
import {DataPacket, MataData, QueryDataList, } from 'pengesoft-ng-lib';


/**
 * 岗位.
 */
@MataData('Job')
export class Job extends DataPacket {
  /**
   * id.
   */
  Id: string;
  /**
   * 部门id.
   */
  DeptId: string;
  /**
   * 岗位名称.
   */
  JobName: string;
  /**
   * 岗位编码.
   */
  JobNum: string;

  constructor(options: any | {
    Id?: string;
    DeptId?: string;
    JobName?: string;
    JobNum?: string;
  } = {}) {
    super();
    this.Id = options.Id || '';
    this.DeptId = options.DeptId || '';
    this.JobName = options.JobName || '';
    this.JobNum = options.JobNum || '';
  }
}


/**
 * 岗位列表
 */
@MataData('JobList')
export class JobList extends QueryDataList<Job> {

  constructor(options: any | {
    _Items?: Array<Job>
  } = {}) {
    // @ts-ignore
    super(options);
    if (options._Items) {
      for (const item of options._Items) {
        this.append(new Job(item));
      }
    }
  }
}
